package com.yuxi.Dao.Impl;

import java.io.Serializable;

import org.springframework.stereotype.Repository;

import com.yuxi.Dao.InfoChangeRecordDao;
import com.yuxi.Entity.InforChangeRecord;
@Repository
public class InforChangeRecordDaoImpl extends BaseDaoImpl<Serializable, Serializable>  implements InfoChangeRecordDao {
	
	public InforChangeRecordDaoImpl(){
		super(InforChangeRecord.class);
	}
	
	@Override
	public void add(InforChangeRecord record) {
		super.add(record);
	}

	@Override
	public void del(InforChangeRecord record) {
		super.delete(record);
	}

	@Override
	public void update(InforChangeRecord record) {
		super.update(record);
	}

	@Override
	public InforChangeRecord getNearlyRecordByInfoId(Integer infoId) {		
		try{
			return (InforChangeRecord) super.find("from InforChangeRecord where infoId=? order by createTime desc",infoId).get(0);
		}catch(Exception e){
			return null;
		}
	}

}
